package mutris.client.handlers;

import java.net.SocketAddress;

import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelDownstreamHandler;

public class BoardSyncChannelHandler extends SimpleChannelDownstreamHandler {

	
	/**
	 *             
	 *   0000 00 00 000 0 0000       = 16 bits
	 *   0-63   | 0-31 | 0-31
	 *   height                      = 6 bits
	 *            width              = 5 bits
	 *                   type        = 5 bits
	 */
	

    /**
     * Invoked when {@link Channel#connect(SocketAddress)} was called.
     */
    public void connectRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
        
    	ctx.sendDownstream(e);
    }

    
    /**
     * Invoked when {@link Channel#write(Object)} is called.
     */
    public void writeRequested(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
    	
        ctx.sendDownstream(e);
    }

    /**
     * Invoked when {@link Channel#disconnect()} was called.
     */
    public void disconnectRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    	
        ctx.sendDownstream(e);
    }
	
}
